import Vue from 'vue';
import axios from 'axios';
import { showMessage } from '@/utils/utils'
const Axios = axios.create({
  baseURL : 'http://120.79.139.100:8080/hotel/api/',
  timeout : 5000 
})

// 是否具备发送post请求权限
Axios.havePostPermission = true

// 请求拦截
Axios.interceptors.request.use(function (config) {
  if(config.method === 'post' && !Axios.havePostPermission) {
    Axios.toWarning = true
    return
  }
  return config
});



Vue.prototype.$axios = Axios

export default Axios

